﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Intrinsics.Arm;
using System.Text;
using System.Threading.Tasks;

namespace Demo
{
    public class AIYDemo : DbContext
    {
        public AIYDemo(DbContextOptions<AIYDemo> opts) : base(opts) { }
        public DbSet<AIY> AIY { get; set; }


        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<AIY>().HasData(new AIY() { 
                id=Guid.NewGuid(),
                FirstName="张",
                LastName="三",
                Age=16,
                DateTime = DateTime.Now
            });
            modelBuilder.Entity<AIY>().HasData(new AIY()
            {
                id = Guid.NewGuid(),
                FirstName = "李",
                LastName = "四",
                Age = 16,
                DateTime = DateTime.Now
            });
        }
    }
 }

